Dopendir

Section: Oct. 1, 1991 (2)
Updated: MiNT Programmer's Manual
Index Return to Main Contents
 

NAME

Dopendir - open a directory for reading  

SYNOPSIS

LONG Dopendir( char *name, WORD flag );
 

DESCRIPTION

Dopendir opens the directory whose name is pointed to by name for reading. A 32 bit directory handle is returned which may be passed to Dreaddir to actually read the directory. flag controls the way directory operations are performed. If flag == 1, then the directory is read in "compatibility" mode, if flag == 0 then directory operations are performed in "normal" mode. In "compatibility" mode, file systems act as if the Fsfirst and Fsnext functions were being used; in particular, if it is possible file names will be restricted to the DOS 8 character name + 3 character extension convention, and will be in upper case. In "normal" mode, file systems do not attempt to restrict the range of names. Moreover, in this mode the Dreaddir system call will also return a file index number (similar to the Unix inode number) along with the file name.

New programs should generally use normal mode where possible.  

RETURNS

A 32 bit directory handle, on success. Note that this handle may be negative, but will never contain the pattern 0xFF in the upper byte, whereas all errors do contain this pattern in the upper byte.

EPTHNF if name is not a valid directory

EACCDN if the directory is not accessible by this program

ENSMEM if the kernel is unable to allocate memory needed for the directory operations  

SEE ALSO

Dclosedir(2), Dreaddir(2), Drewinddir(2)  

BUGS

Failure to call Dclosedir() when the search is done could result in the system eventually running out of file indices; this is fatal. So always call Dclosedir() when you're finished with the directory search!


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURNS
SEE ALSO
BUGS

This document was created by man2html, using the manual pages.
Time: 11:14:47 GMT, June 22, 2025